DRAFT: feat(accounts): recognize burn address in SNS token transfer#7831
DRAFT: feat(accounts): recognize burn address in SNS token transfer#7831
Conversation
ae017a0 to
cd9b297
Compare
cd9b297 to
fd01f02
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds burn-address (minting account) recognition for SNS/ICRC token transfers so the UI can treat transfers to the minting account as burns (fee-free) and submit the transfer with fee: 0n.
Changes:
- Added
queryIcrcMintingAccountto fetch an ICRC ledger’s minting account and wired it intoIcrcTokenTransactionModalon mount. - Introduced a
burnAddressprop throughTransactionModal→TransactionFormto detect burn destinations and adjust UI/validation and transfer fee. - Added unit tests/page-object helpers covering burn label visibility and fee/transfer behavior.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/lib/api/icrc-ledger.api.ts | Adds queryIcrcMintingAccount API wrapper to retrieve minting account. |
| frontend/src/lib/modals/accounts/IcrcTokenTransactionModal.svelte | Fetches minting account on mount, derives burnAddress, and submits transfers with fee: 0n for burns. |
| frontend/src/lib/modals/transaction/TransactionModal.svelte | Threads burnAddress into the form and suppresses fee display in the review step for burn destinations. |
| frontend/src/lib/components/transaction/TransactionForm.svelte | Detects burn destination, uses effective fee 0 for max/validation, and shows a “Burn address” label while hiding the fee component. |
| frontend/src/lib/i18n/en.json | Adds the new accounts.burn_address string. |
| frontend/src/lib/types/i18n.d.ts | Extends i18n typing to include burn_address. |
| frontend/src/tests/lib/modals/accounts/IcrcTokenTransactionModal.spec.ts | Adds burn-address test coverage (label visibility, fee handling, fee passed to transfer). |
| frontend/src/tests/page-objects/TransactionForm.page-object.ts | Adds helpers to detect burn label and fee presence. |
| frontend/src/tests/lib/pages/SnsWallet.spec.ts | Stubs queryIcrcMintingAccount to avoid real calls during wallet tests. |
| CHANGELOG-Nns-Dapp-unreleased.md | Documents the burn-address UX change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
SNS tokens can be burned by sending them to the minting account (burn address). When a user does this, no transaction fee is charged. The UI should recognize this scenario and reflect it clearly instead of displaying a regular fee.
Changes
queryIcrcMintingAccountAPI function to fetch the minting account for an ICRC ledger canister.IcrcTokenTransactionModaland encoded it as a burn address string.burnAddressprop inTransactionModalandTransactionFormto identify when the destination matches the burn address.fee: 0nto the transfer call when sending to the burn address.Tests
Todos